package com.yonyou.ncmm_pac_pda;

import com.yonyou.uap.um.application.ApplicationContext;
import com.yonyou.uap.um.base.*;
import com.yonyou.uap.um.common.*;
import com.yonyou.uap.um.third.*;
import com.yonyou.uap.um.control.*;
import com.yonyou.uap.um.core.*;
import com.yonyou.uap.um.binder.*;
import com.yonyou.uap.um.runtime.*;
import com.yonyou.uap.um.lexer.*;
import com.yonyou.uap.um.widget.*;
import com.yonyou.uap.um.widget.UmpSlidingLayout.SlidingViewType;
import com.yonyou.uap.um.log.ULog;
import java.util.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.webkit.*;
import android.content.*;
import android.graphics.*;
import android.widget.ImageView.ScaleType;

public abstract class RefTextDemoWindowActivity extends UMWindowActivity {

	protected UMWindow RefTextDemoWindow = null;
protected XVerticalLayout viewPage0 = null;
protected UMScrollView Scrollview_wpanel10 = null;
protected XVerticalLayout wpanel10 = null;
protected XHorizontalLayout wpanel0 = null;
protected UMLabel wlabel0 = null;
protected UMLabel wlabel1 = null;
protected UMTextbox txt_material = null;
protected XHorizontalLayout wpanel4 = null;
protected UMLabel wlabel8 = null;
protected UMLabel wlabel9 = null;
protected UMNumberEdit wnumber0 = null;
protected XVerticalLayout wpanel5 = null;
protected UMListViewBase list_dynamic = null;
protected XVerticalLayout pnl_refinfo = null;
protected UMLabel lbl_mid = null;
protected UMLabel lbl_orgid = null;
protected UMLabel lbl_price = null;
protected UMButton btn_submit = null;
protected UMButton btn_fetchvalue = null;
protected UMButton btn_initlist = null;

	
	protected final static int ID_REFTEXTDEMOWINDOW = 569858538;
protected final static int ID_VIEWPAGE0 = 179144796;
protected final static int ID_SCROLLVIEW_WPANEL10 = 1561717075;
protected final static int ID_WPANEL10 = 2086504482;
protected final static int ID_WPANEL0 = 116492496;
protected final static int ID_WLABEL0 = 1267731861;
protected final static int ID_WLABEL1 = 1133776985;
protected final static int ID_TXT_MATERIAL = 647632533;
protected final static int ID_WPANEL4 = 298537877;
protected final static int ID_WLABEL8 = 944242787;
protected final static int ID_WLABEL9 = 1805687601;
protected final static int ID_WNUMBER0 = 22357143;
protected final static int ID_WPANEL5 = 385244906;
protected final static int ID_LIST_DYNAMIC = 98793635;
protected final static int ID_PNL_REFINFO = 1122439883;
protected final static int ID_LBL_MID = 1656849045;
protected final static int ID_LBL_ORGID = 232884221;
protected final static int ID_LBL_PRICE = 51637052;
protected final static int ID_BTN_SUBMIT = 2008642083;
protected final static int ID_BTN_FETCHVALUE = 120039717;
protected final static int ID_BTN_INITLIST = 2082712022;

	
	
	@Override
	public String getControllerName() {
		return "RefTextDemoWindowController";
	}
	
	@Override
	public String getContextName() {
		return "";
	}

	@Override
	public String getNameSpace() {
		return "com.yonyou.ncmm_pac_pda";
	}

	protected void onCreate(Bundle savedInstanceState) {
		ULog.logLC("onCreate", this);
		super.onCreate(savedInstanceState);
        onInit(savedInstanceState);
        
	}
	
	@Override
	protected void onStart() {
		ULog.logLC("onStart", this);
		
		super.onStart();
	}

	@Override
	protected void onRestart() {
		ULog.logLC("onRestart", this);
		
		super.onRestart();
	}

	@Override
	protected void onResume() {
		ULog.logLC("onResume", this);
		
		super.onResume();
	}

	@Override
	protected void onPause() {
		ULog.logLC("onPause", this);
		
		super.onPause();
	}

	@Override
	protected void onStop() {
		ULog.logLC("onStop", this);
		
		super.onStop();
	}

	@Override
	protected void onDestroy() {
		ULog.logLC("onDestroy", this);
		
		super.onDestroy();
	}
	
	public  void onInit(Bundle savedInstanceState) {
		ULog.logLC("onInit", this);
		UMActivity context = this;
		registerControl();
		this.getContainer();
		
		/*
		 new Thread() {
			 public void run() {
				 UMPDebugClient.startServer();
			 }
		 }.start();
		*/
		String sys_debug = ApplicationContext.getCurrent(this).getValue("sys_debug");
		if (sys_debug != null && sys_debug.equalsIgnoreCase("true")) {
			UMPDebugClient.waitForDebug();
		}

		IBinderGroup binderGroup = this;
		currentPage = getCurrentWindow(context, binderGroup);
super.setContentView(currentPage);

		
	}
	
	private void registerControl() {
		  idmap.put("RefTextDemoWindow",ID_REFTEXTDEMOWINDOW);
  idmap.put("viewPage0",ID_VIEWPAGE0);
  idmap.put("Scrollview_wpanel10",ID_SCROLLVIEW_WPANEL10);
  idmap.put("wpanel10",ID_WPANEL10);
  idmap.put("wpanel0",ID_WPANEL0);
  idmap.put("wlabel0",ID_WLABEL0);
  idmap.put("wlabel1",ID_WLABEL1);
  idmap.put("txt_material",ID_TXT_MATERIAL);
  idmap.put("wpanel4",ID_WPANEL4);
  idmap.put("wlabel8",ID_WLABEL8);
  idmap.put("wlabel9",ID_WLABEL9);
  idmap.put("wnumber0",ID_WNUMBER0);
  idmap.put("wpanel5",ID_WPANEL5);
  idmap.put("list_dynamic",ID_LIST_DYNAMIC);
  idmap.put("pnl_refinfo",ID_PNL_REFINFO);
  idmap.put("lbl_mid",ID_LBL_MID);
  idmap.put("lbl_orgid",ID_LBL_ORGID);
  idmap.put("lbl_price",ID_LBL_PRICE);
  idmap.put("btn_submit",ID_BTN_SUBMIT);
  idmap.put("btn_fetchvalue",ID_BTN_FETCHVALUE);
  idmap.put("btn_initlist",ID_BTN_INITLIST);

	}
	
	public void onLoad() {
		ULog.logLC("onLoad", this);
		if(currentPage!=null) {
			currentPage.onLoad();
		}
	
		{ //viewPage0 - action:viewpage0_onload
    UMEventArgs args = new UMEventArgs(RefTextDemoWindowActivity.this);
    actionViewpage0_onload(viewPage0,args);

}
{ //pnl_refinfo - action:pnl_refinfo_onload
    UMEventArgs args = new UMEventArgs(RefTextDemoWindowActivity.this);
    actionPnl_refinfo_onload(pnl_refinfo,args);

}

	}
	
	public void onDatabinding() {
		ULog.logLC("onDatabinding", this);
		super.onDatabinding();
		
	}
	
	@Override
	public void onReturn(String methodName, Object returnValue) {
		
	}

	@Override
	public void onAfterInit() {
		ULog.logLC("onAfterInit", this);
		
		onLoad();
	}
	
		@Override
	public Map<String,String> getPlugout(String id) {
		XJSON from = this.getUMContext();
		Map<String,String> r = super.getPlugout(id);
		
		return r;	
	}
	
	
	
	public View getWpanel0View(final UMActivity context,IBinderGroup binderGroup) {
wpanel0 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_WPANEL0
,"width","fill"
,"valign","center"
,"background-image","list_row_down1.png"
,"layout-type","vbox"
,"halign","LEFT"
,"height","44"
);
wlabel0 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_WLABEL0
,"color","#000000"
,"onclick","action:wlabel0_onclick"
,"width","70"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","right"
,"content","物料"
,"margin-right","10"
,"height","20"
);
wpanel0.addView(wlabel0);
wlabel1 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_WLABEL1
,"color","#000000"
,"background","#c0c0c0"
,"width","1"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","center"
,"content","label"
,"height","35"
);
wpanel0.addView(wlabel1);
txt_material = (UMTextbox)ThirdControl.createControl(new UMTextbox(context),ID_TXT_MATERIAL
,"onlongclick","action:txt_material_onlongclick"
,"color","#167ef8"
,"maxlength","256"
,"padding-left","4"
,"weight","1"
,"font-size","17"
,"margin-left","10"
,"bindfield","txt_material"
,"background","#ffffff"
,"width","0"
,"font-family","default"
,"placeholder","物料"
,"layout-type","hbox"
,"halign","LEFT"
,"height","43"
);
wpanel0.addView(txt_material);

return wpanel0;
}
public View getWpanel4View(final UMActivity context,IBinderGroup binderGroup) {
wpanel4 = (XHorizontalLayout)ThirdControl.createControl(new XHorizontalLayout(context),ID_WPANEL4
,"width","fill"
,"valign","center"
,"background-image","list_row_down1.png"
,"layout-type","vbox"
,"halign","LEFT"
,"height","44"
);
wlabel8 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_WLABEL8
,"color","#000000"
,"width","70"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","right"
,"content","单价"
,"margin-right","10"
,"height","20"
);
wpanel4.addView(wlabel8);
wlabel9 = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_WLABEL9
,"color","#000000"
,"background","#c0c0c0"
,"width","1"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","hbox"
,"halign","center"
,"content","label"
,"height","35"
);
wpanel4.addView(wlabel9);
wnumber0 = (UMNumberEdit)ThirdControl.createControl(new UMNumberEdit(context),ID_WNUMBER0
,"color","#167ef8"
,"max","9.99999999E8"
,"precision","2"
,"padding-left","4"
,"roundtype","value"
,"weight","1"
,"font-size","14"
,"roundvalue","5"
,"margin-left","10"
,"min","-9.99999999E8"
,"background","#ffffff"
,"width","0"
,"font-family","default"
,"placeholder","1,000.32"
,"layout-type","hbox"
,"halign","LEFT"
,"padding-right","4"
,"height","43"
);
wpanel4.addView(wnumber0);

return wpanel4;
}
public View getPnl_refinfoView(final UMActivity context,IBinderGroup binderGroup) {
pnl_refinfo = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_PNL_REFINFO
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"onload","action:pnl_refinfo_onload"
,"height","90"
);
lbl_mid = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LBL_MID
,"bindfield","lbl_mid"
,"color","#000000"
,"width","fill"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","vbox"
,"halign","left"
,"content","label"
,"height","30"
);
pnl_refinfo.addView(lbl_mid);
lbl_orgid = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LBL_ORGID
,"bindfield","lbl_orgid"
,"color","#000000"
,"width","fill"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","vbox"
,"halign","left"
,"content","label"
,"height","30"
);
pnl_refinfo.addView(lbl_orgid);
lbl_price = (UMLabel)ThirdControl.createControl(new UMLabel(context),ID_LBL_PRICE
,"bindfield","lbl_price"
,"color","#000000"
,"width","fill"
,"font-size","14"
,"font-family","default"
,"valign","center"
,"layout-type","vbox"
,"halign","left"
,"content","label"
,"height","30"
);
pnl_refinfo.addView(lbl_price);

return pnl_refinfo;
}
public View getList_dynamicView(final UMActivity context,IBinderGroup binderGroup) {
list_dynamic = (UMListViewBase)ThirdControl.createControl(new UMListViewBase(context),ID_LIST_DYNAMIC
,"layout","vbox"
,"bindfield","list_dynamic"
,"collapsed","true"
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"height","300"
);
list_dynamic.addListItemView("getPnl_refinfoView");

return list_dynamic;
}
public View getWpanel10View(final UMActivity context,IBinderGroup binderGroup) {
wpanel10 = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_WPANEL10
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"height","wrap"
);
View wpanel0 = (View) getWpanel0View((UMActivity)context,binderGroup);
wpanel10.addView(wpanel0);
View wpanel4 = (View) getWpanel4View((UMActivity)context,binderGroup);
wpanel10.addView(wpanel4);
wpanel5 = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_WPANEL5
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"height","10"
);
wpanel10.addView(wpanel5);
View list_dynamic = (View) getList_dynamicView((UMActivity)context,binderGroup);
wpanel10.addView(list_dynamic);
btn_submit = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BTN_SUBMIT
,"font-pressed-color","#e50011"
,"color","#ffffff"
,"onclick","action:btn_submit_onclick"
,"font-size","20"
,"valign","center"
,"margin-right","10"
,"margin-left","10"
,"background","#f7931e"
,"width","fill"
,"font-family","default"
,"margin-top","20"
,"layout-type","vbox"
,"halign","center"
,"margin-bottom","20"
,"value","添加"
,"height","44"
);
wpanel10.addView(btn_submit);
btn_fetchvalue = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BTN_FETCHVALUE
,"color","#e50011"
,"onclick","action:btn_fetchvalue_onclick"
,"font-size","17"
,"valign","center"
,"margin-right","10"
,"margin-left","10"
,"background","#f7931e"
,"width","fill"
,"font-family","default"
,"layout-type","vbox"
,"halign","center"
,"value","取值"
,"height","44"
);
wpanel10.addView(btn_fetchvalue);
btn_initlist = (UMButton)ThirdControl.createControl(new UMButton(context),ID_BTN_INITLIST
,"color","#e50011"
,"onclick","action:btn_initlist_onclick"
,"font-size","17"
,"valign","center"
,"margin-right","10"
,"margin-left","10"
,"background","#f7931e"
,"width","fill"
,"font-family","default"
,"margin-top","20"
,"layout-type","vbox"
,"halign","center"
,"value","初始化列表"
,"height","44"
);
wpanel10.addView(btn_initlist);

return wpanel10;
}
public View getScrollview_wpanel10View(final UMActivity context,IBinderGroup binderGroup) {
Scrollview_wpanel10 = (UMScrollView)ThirdControl.createControl(new UMScrollView(context),ID_SCROLLVIEW_WPANEL10
,"layout","vbox"
,"width","fill"
,"hscrollenabled","disabled"
,"layout-type","vbox"
,"height","fill"
);
View wpanel10 = (View) getWpanel10View((UMActivity)context,binderGroup);
Scrollview_wpanel10.addView(wpanel10);

return Scrollview_wpanel10;
}
public View getViewPage0View(final UMActivity context,IBinderGroup binderGroup) {
viewPage0 = (XVerticalLayout)ThirdControl.createControl(new XVerticalLayout(context),ID_VIEWPAGE0
,"background","#F5F5F5"
,"width","fill"
,"valign","TOP"
,"layout-type","vbox"
,"halign","center"
,"content","         ﻿    "
,"onload","action:viewpage0_onload"
,"height","fill"
);
View Scrollview_wpanel10 = (View) getScrollview_wpanel10View((UMActivity)context,binderGroup);
viewPage0.addView(Scrollview_wpanel10);

return viewPage0;
}
public UMWindow getCurrentWindow(final UMActivity context,IBinderGroup binderGroup) {
RefTextDemoWindow = (UMWindow)ThirdControl.createControl(new UMWindow(context),ID_REFTEXTDEMOWINDOW
,"layout","vbox"
,"controller","RefTextDemoWindowController"
,"namespace","com.yonyou.ncmm_pac_pda"
,"width","fill"
,"valign","TOP"
,"layout-type","linear"
,"halign","center"
,"height","fill"
);
View viewPage0 = (View) getViewPage0View((UMActivity)context,binderGroup);
RefTextDemoWindow.addView(viewPage0);

return (UMWindow)RefTextDemoWindow;
}

	
	public void actionBtn_fetchvalue_onclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "btn_fetchvalue_onclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.btn_fetchvalue_onclick()",UMActivity.getViewId(control),args);
}
public void actionWlabel0_onclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "wlabel0_onclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.wlabel0_onclick()",UMActivity.getViewId(control),args);
}
public void actionTxt_material_onlongclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "txt_material_onlongclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.txtmaterial_onlongclick()",UMActivity.getViewId(control),args);
}
public void actionPnl_refinfo_onload(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "pnl_refinfo_onload";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.pnlrefinfo_onload()",UMActivity.getViewId(control),args);
}
public void actionBtn_submit_onclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "btn_submit_onclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.wbutton1_onclick()",UMActivity.getViewId(control),args);
}
public void actionViewpage0_onload(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "viewpage0_onload";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.viewPage0_onload()",UMActivity.getViewId(control),args);
}
public void actionBtn_initlist_onclick(View control, UMEventArgs args) {
    args.put("containerName","");
    args.put("language","javascript");
    String actionid = "btn_initlist_onclick";
  ActionProcessor.exec(this, actionid, args);
  this.getContainer().exec(actionid, "this.btn_initlist_onclick()",UMActivity.getViewId(control),args);
}


}
